| Conditions | 7 |
| Total Lines | 24 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import NewPollFormCard from '../cards/NewPollFormCard'; |
||
| 26 | |||
| 27 | process(): chatV1.Schema$Message { |
||
| 28 | switch (this.slashCommand!.commandName) { |
||
| 29 | case '/poll': |
||
| 30 | const argumentText = this.event.message?.argumentText?.trim() ?? ''; |
||
| 31 | const options = buildOptionsFromMessage(argumentText); |
||
| 32 | return { |
||
| 33 | actionResponse: { |
||
| 34 | type: 'DIALOG', |
||
| 35 | dialogAction: { |
||
| 36 | dialog: { |
||
| 37 | body: new NewPollFormCard(options, this.getUserTimezone()).create(), |
||
| 38 | }, |
||
| 39 | }, |
||
| 40 | }, |
||
| 41 | }; |
||
| 42 | default: |
||
| 43 | const isPrivate = this.event.space?.type === 'DM'; |
||
| 44 | return { |
||
| 45 | thread: this.event.message!.thread, |
||
| 46 | actionResponse: { |
||
| 47 | type: 'NEW_MESSAGE', |
||
| 48 | }, |
||
| 49 | text: generateHelpText(isPrivate), |
||
| 50 | }; |
||
| 54 |